#FROM java:8
FROM jdk8:v1.0

MAINTAINER WUYF
# 设置工作目录
WORKDIR /opt

ADD target/maintain-104-1.0-SNAPSHOT.jar maintain-104-1.0-SNAPSHOT.jar

RUN bash -c "touch maintain-104-1.0-SNAPSHOT.jar"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

VOLUME /opt/maintain-104

EXPOSE 8400 10002


ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8

ENV JAVA_OPTS="-Xms512m -Xmx512m"
ENV spring_profiles_active = "dev"
ENV iot_protocol_address = "10.152.64.36:2404"
ENV kafka_address = "localhost:9092"

# 以下两种方法启动都可以
ENTRYPOINT java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/dump/heapdump_maintain104.hprof -server -Dfile.encoding=utf-8 -jar maintain-104-1.0-SNAPSHOT.jar \
--spring.profiles.active=${spring_profiles_active} --iot.protocol.address=${iot_protocol_address} --spring.kafka.producer.bootstrap-servers=${kafka_address}

#ENTRYPOINT  ["sh", "-c","/opt/bin/run.sh"]
